<%-- 
    Document   : formAjoutPromo
    Created on : 23 mars 2013, 08:02:37
    Author     : ali
--%>



<%@page import="java.util.Calendar"%>
<%@page import="java.util.HashMap"%>
<%@page import="EDT.obj.Formation"%>
<%@page import="java.util.ArrayList"%>
<%@page import="java.text.SimpleDateFormat"%>
<%@page import="java.util.Date"%>
<%@page import="java.text.DateFormat"%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
                
        <title>Créer une promotion</title>
            <link rel="stylesheet" href="Accueil.css" />
            <link rel="SHORTCUT ICON" href="./edt.jpg" />
    </head>


    <body>    
         
    <section>
      

        

        
         
    <!--<form method='POST' action='PromoNivGradForm.do'> -->
   <%
     String form ="";
    ArrayList<Formation> formation = new ArrayList<Formation>();
    
    
        
        formation = EDT.api.API.getFormation();
        session.setAttribute( "formation", formation );
        form += "<form method='POST' action='AjoutPromo2.do' target='section'>";
        form += "<div class='commentaire'>";
        form += "<fieldset>";
        
        
        form +="<legend>    Ajouter une promotion  :   </legend>";
        form +="Formation : <select name='formation'>";
        for (Formation f : formation)
        form +="    <option value='"+f.getId()+"'>"+f.getNom()+" Expire:"+f.getAnneeEx()+"</option>";
        form +="</select><br/><br/>";
     
        form +="<input type='hidden' name='key' value='"+session.getAttribute("key")+"' />";
        
        DateFormat dateFormat = new SimpleDateFormat("yyyy");
        Calendar cal = Calendar.getInstance(); 
        cal.setTime(new Date());
        Integer a =Integer.parseInt(dateFormat.format(cal.getTime()));
        
        form +="Année universitaire : <input type='text' name='annee' value='"+a+"'/><br/><br/>";
        
        form +="Nombre de groupe : <input type='text' name='grp' value='1'/><br/><br/>";
            
        form +="<input type='submit' value='valider'/><br/>";
        out.println(form);
            
    %>
    
   
    
    
    <html:errors/> 
    
    </fieldset>
    
        
    </div>

    </form>
         
    </section>
    </body>
</html>